package com.siebre.picclife.asynctask.service;

import java.util.List;

import com.siebre.picclife.asynctask.model.Task;

/**
 * 
 * @author ZhangChi
 * @since 2015年4月2日
 */
public interface TaskRepository {

	void save(Task task);
	
	Task findOne(long id);
	
	List<Task> findByArgument(String argument);
	
	//XXX should return Page, now it is unnecessary to bother with it, use types from Spring Data after introducing it.
	List<Task> findNewTasks(int pageIndex, int pageSize);
	
	List<Task> findFailedTasks(int pageIndex, int pageSize);

	List<Task> findProcessingTasks(int pageIndex, int pageSize);
	
	List<Task> findProcessingTasks(String processor, int pageIndex, int pageSize);

	void deleteAll();
}
